#include "user.h"
#include "ui_user.h"

#include "userchange.h"
#include "library.h"
#include <QSqlTableModel>
User::User(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::User)
{
    ui->setupUi(this);
}

User::~User()
{
    delete ui;
}

void User::on_pushButtonChange_clicked()
{
   UserChange *user = new UserChange();
   user->show();
   close();
}

void User::on_pushButton_2_clicked()
{
    close();
}

void User::on_pushButtonSeach_clicked()
{
    Library *b_s = new Library();
    b_s->show();
    close();
}

void User::on_pushButtonBorrow_clicked()
{
    model = new QSqlTableModel(this);
    model->setTable("loans");
    model->select();
    ui->tableView->setModel(model);
}
